/*Copyright (C) 2011  Jens Schwarzhaupt

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.*/

package de.dhbw.GpsTools;
import java.util.Date;

/**This class represents a single waypoint of a gps track.
 * 
 * @author Jens Schwarzhaupt
 *
 */
public class Waypoint {
	
	private double latitude;
	private double longitude;
	private Date time;
	private int satFixQuality;
	private int numberOfSats;
	private double elevation;
	private double speed;
	private double course;
	
	/**Constructor
	 * If a new Waypoint object is constructed all properties are set to "-1". 
	 * The "time" property is set to the current time.
	 * 
	 */
	public Waypoint(){
		latitude = -1;
		longitude = -1;
		time = new Date(System.currentTimeMillis());
		satFixQuality = -1;
		numberOfSats = -1;
		elevation = -1;
		speed = -1;
		course = -1;
	}
	
	/**Set the Latitude of the waypoint.
	 * 
	 * @param lat The latitude
	 */
	public void setLatitude(double lat){
		latitude = lat;
	}
	
	/**Get the latitude of the waypoint.
	 * 
	 * @return The latitude as double.
	 */
	public double getLatitude(){
		return latitude;
	}
	
	/**Set the Longitude of the waypoint.
	 * 
	 * @param lon The longitude
	 */
	public void setLongitude(double lon){
		longitude = lon;
	}
	
	/**Get the longitude of the waypoint.
	 * 
	 * @return The longitude as double.
	 */
	public double getLongitude(){
		return longitude;
	}
	
	/**Set the time of the waypoint.
	 * 
	 * @param tim The time.
	 */
	public void setTime(Date tim){
		time = tim;
	}
	
	/**Get the time of the waypoint.
	 * 
	 * @return The time.
	 */
	public Date getTime(){
		return time;
	}
	
	/**Set the satfix quality of the waypoint.
	 * 
	 * @param fix The satfix quality. "2" = 2D; "3" = "3D".
	 */
	public void setSatFixQuality(int fix){
		satFixQuality = fix;
	}
	
	/**Get the satfix quality of the waypoint.
	 * 
	 * @return The satfix quality as int. "2" = 2D; "3" = "3D".
	 */
	public int getSatFixQuality(){
		return satFixQuality;
	}
	
	/**Set the number of satellites of the waypoint.
	 * 
	 * @param num The number of satellites.
	 */
	public void setNumberOfSats(int num){
		numberOfSats = num;
	}
	
	/**Get the number of satellites the waypoint has.
	 * 
	 * @return The number of satellites as int.
	 */
	public int getNumberOfSats(){
		return numberOfSats;
	}
	
	/**Set the elevation of the waypoint.
	 * 
	 * @param ele The elevation.
	 */
	public void setElevation(double ele){
		elevation = ele;
	}
	
	/**Get the elevation of the waypoint.
	 * 
	 * @return The elevation as double.
	 */
	public double getElevation(){
		return elevation;
	}
	
	/**Set the speed of the waypoint.
	 * 
	 * @param spd The speed.
	 */
	public void setSpeed(double spd){
		speed = spd;
	}
	
	/**Get the speed of the waypoint.
	 * 
	 * @return The speed as double. 
	 */
	public double getSpeed(){
		return speed;
	}
	
	/**Set the course of the waypoint.
	 * 
	 * @param crs The course.
	 */
	public void setCourse(double crs){
		course = crs;
	}
	
	/**Get the course of the waypoint.
	 * 
	 * @return The course as double.
	 */
	public double getCourse(){
		return course;
	}
}
